package com.datareport.domain.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

/**
 * 数据抽取配置DTO
 */
@Data
public class ExtractConfigDTO {
    private String configId;
    
    @NotBlank(message = "数据源名称不能为空")
    private String sourceName;
    
    @NotBlank(message = "数据源类型不能为空")
    private String sourceType;
    
    @NotBlank(message = "数据源配置不能为空")
    private String sourceConfig;
    
    @NotBlank(message = "抽取表名不能为空")
    private String extractTable;
    
    @NotBlank(message = "抽取字段不能为空")
    private String extractFields;
    
    private String extractCondition;
    
    private String incrementField;
    
    @Pattern(regexp = "^(\\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]) (\\*|([0-9]|1[0-9]|2[0-3])) (\\*|([1-9]|1[0-9]|2[0-9]|3[0-1])) (\\*|([1-9]|1[0-2])) (\\*|([0-6])))$", 
            message = "抽取频率格式不正确")
    private String extractFrequency;
    
    private Integer status = 1;
}